import Fluent

struct CreateReferenceText: Migration {
    
    func prepare(on database: Database) -> EventLoopFuture<Void> {
        database.schema("referencetext")
            .id()
            .field("fullText", .string)
            .field("isTestimonial", .bool)
            .field("languageIsoCode", .string)
            .field("referenceID", .uuid, .required, .references("reference", "id"))
            .create()
    }
    
    func revert(on database: Database) -> EventLoopFuture<Void> {
        database.schema("referencetext").delete()
    }
}
